import method from '@/api/method'
import config from '@/service/config'
import {
    objToString
} from '@/utils/helper'

// 办理中 列表
export function get_order_model_by_status(params) {
    return method.post('qdsflsc/api/portal/order/v1/get_order_model_by_status.do', params)
}

// 办理中 产品模式列表
export function get_product_model_by_status(params) {
    return method.post('qdsflsc/api/portal/order/v1/get_product_model_by_status.do', params)
}

// 动态搜索
export function find_product(params) {
    return method.post(`qdsflsc/api/white/common/v1/search_product.do`, params)
}

// 退单申请
export function apply_back_order_audit(params) {
    return method.post('qdsflsc/api/portal/order/v1/apply_back_order_audit.do', params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}

// 结案
export function apply_case_audit(params) {
    return method.post('qdsflsc/api/portal/order/v1/apply_case_audit.do', params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}

// 获取业务底单
export function get_order_business(params) {
    return method.get(`qdsflsc/api/portal/order/v1/get_order_business.do${objToString(params)}`)
}

// 编辑业务底单
export function edit_bottom_sheet(params) {
    return method.post(`qdsflsc/api/portal/order/v1/edit_order_business.do`, params)
}

// 订单id查询项目成员
export function get_assist_handle(params) {
    return method.get(`qdsflsc/api/portal/project_member/v1/get_project_member.do${objToString(params)}`)
}

// 附件文档列表
export function search_files(params) {
    return method.get(config.fileUrl + objToString(params), params)
}

// cms附件文档列表
export function search_files_cms(params) {
    return method.get(`qdsflsc/api/white/common/v1/query_cms_annex.do${objToString(params)}`, params)
}

// 附件文档列表
export function update_files(params) {
    return method.get(config.updateUrl + objToString(params), {
        isXReqUserName: true
    })
}

// 附件文档列表
export function delete_files(params) {
    return method.get(config.deleteUrl + objToString(params), params)
}

// 设置协办人主办或协办
export function edit_assist_handle_main_Handle(params) {
    return method.post('qdsflsc/api/portal/project_member/v1/edit_project_member_main_Handle.do', params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}

// 删除协办人
export function delete_assist_handle(params) {
    return method.post('qdsflsc/api/portal/project_member/v1/delete_project_member.do', params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}

// 修改项目管理人
export function update_project_manager(params) {
    return method.post('qdsflsc/api/portal/project_member/v1/update_project_manager.do', params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}

// 新增协办人
export function add_assist_handle(params) {
    return method.post('qdsflsc/api/portal/project_member/v1/add_project_member.do', params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}

//获取所有法院接口
export function get_court_with_page(params) {
    return method.post('qdsflsc/api/system/bottom/v1/get_court_with_page.do', params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}

export function undo_case_audit(params) {
    return method.post(`qdsflsc/api/portal/order/v1/undo_case_audit.do${objToString(params)}`, params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}

export function undo_back_order_audit(params) {
    return method.post(`qdsflsc/api/portal/order/v1/undo_back_order_audit.do${objToString(params)}`, params, {
        isXAuthToken: true,
        isXReqUserId: true
    })
}